package com.weilive.core.message;

import org.apache.commons.lang.builder.ToStringBuilder;

public class MessageImpl implements Message {
	private MessageType type;
	private Object object;

	public void setType(MessageType type) {
		this.type = type;
	}

	public void setObject(Object object) {
		this.object = object;
	}

	@SuppressWarnings("unchecked")
	@Override
	public <T extends Object> T getObject() {
		return (T) this.object;
	}

	@Override
	public MessageType getType() {
		return this.type;
	}

	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
